package com.ljj.user.controller;

import com.ljj.user.pojo.User;
import com.ljj.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author Administrator
 * @Date 2022/3/17 15:19
 * @Version 1.0
 */

@RestController
@RequestMapping("/user")
@RefreshScope
public class UserController {
    @Autowired
    private UserService userService;

    @Value("${test.name}")
    private String name ;

    @GetMapping("/get/{id}")
    public User queryById(@PathVariable Long id) throws InterruptedException {
        System.out.println("配置中的test.name = " + name);
        return userService.queryById(id);
    }

}
